module Mix.Views {
    /**
     * BaseViews
     */
    export class BaseViews extends eui.Component{
        constructor(skinName?:string) {
            super();
            
            this.once(eui.UIEvent.CREATION_COMPLETE,this.initCreationComplete,this);
            if(skinName){
                this.skinName = skinName;
            }
        }
        
        /**
         * initCreationComplete
         * 皮肤创建完成时 只加载一次
         */
        public initCreationComplete() {
            this.width = this.stage.stageWidth;
            this.height = this.stage.stageHeight;
        }
        
        /**
         * openView
         * 打开界面
         */
        public openView() {
            majiang.Controllers.StageMain.addChild(this);
        }
        
        /**
         * closeView
         * 关闭界面
         */
        public closeView() {
            this.parent.removeChild(this);
        }
    }
}